package com.cqupt.controller;

import com.cqupt.model.pojo.BookCategory;
import com.cqupt.model.vo.Result;
import com.cqupt.model.vo.ResultCodeEnum;
import com.cqupt.service.BookCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/category")
@Tag(name = "词书分类模块")
public class BookCategoryController {

    @Resource
    private BookCategoryService bookCategoryService;

    @GetMapping("/all")
    @Operation(summary = "显示词书分类")
    public Result all() {
        List<BookCategory> list = bookCategoryService.all();
        return Result.build(list, ResultCodeEnum.SUCCESS);
    }


}
